#include <stdio.h>

unsigned char bitAt[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
unsigned char testChar[] = { 0x0A };

int main(int argc, char *argv[]) {
	int i;
	int blockIx = 5;
	for (i=0; i<8; i++) {
		printf("bit #%d: %d\n", i, testChar[blockIx/8] & bitAt[i]);
	}
	testChar[blockIx/8] = testChar[blockIx/8] | bitAt[blockIx%8];
	for (i=0; i<8; i++) {
		printf("bit #%d: %d\n", i, testChar[blockIx/8] & bitAt[i]);
	}
	if (testChar[blockIx/8] & bitAt[blockIx%8]) {
		printf("block occupied!\n");
	} else {
		printf("block free!\n");
	}
}